Skip to content

Add Weighted Bridging Centrality plugin - #336

Merged
mbastian merged 6 commits into
gephi:master-forgefrom
natesteinmeyer:master
Sep 26, 2026
Merged

mbastian merged 6 commits into
gephi:master-forgefrom
natesteinmeyer:master

Conversation

@natesteinmeyer

@natesteinmeyer natesteinmeyer commented Aug 18, 2026 •

Copy link
Copy Markdown

New plugin or plugin update?

  • New Plugin
  • Update

What is the purpose of this plugin?

This plugin extends Gephi’s Bridging Centrality metric to weighted networks. It calculates betweenness centrality using weighted shortest paths, interpreting edge weights as connection strengths and converting them to effective distances using d=1/w. It then combines weighted betweenness centrality with the standard bridging coefficient to identify nodes that play important bridging roles between different regions of a weighted network.

How to test your plugin in Gephi?

Build and install the plugin in Gephi 0.11.1.
Create an undirected weighted network with four nodes (A, B, C, D) and the following edges: A–B with weight 10, B–D with weight 10, A–C with weight 1, and C–D with weight 1.
In the Statistics panel, run Weighted Bridging Centrality with Normalized unchecked.
The plugin should add three columns to the Data Laboratory: Weighted Betweenness Centrality, Bridging Coefficient, and Weighted Bridging Centrality.
The expected results are: Node A: Weighted Betweenness = 0.5, Bridging Coefficient = 0.5, Weighted Bridging Centrality = 0.25. Node B: Weighted Betweenness = 1.0, Bridging Coefficient = 0.5, Weighted Bridging Centrality = 0.50. Node C: Weighted Betweenness = 0.0, Bridging Coefficient = 0.5, Weighted Bridging Centrality = 0.00. Node D: Weighted Betweenness = 0.5, Bridging Coefficient = 0.5, Weighted Bridging Centrality = 0.25.

Edge weights are interpreted as connection strengths and converted to effective distances using d = 1/w. Thus, in this example, the path A–B–D has a total effective distance of 0.2, while A–C–D has a total effective distance of 2.0.

Checklist before submission

  • Did you merged with the master branch to get the latest updates?
  • Did you build and test the plugin successfully locally?
  • Did you include metadata (e.g. plugin author, license) in the pom.xml file
  • Did you make sure NOT to include any unnecessary files in your PR?
  • Did you write unit tests to test your plugin functionalities?

mbastian and others added 5 commits September 26, 2026 12:34
The parent version was pinned to 0.11.1 while master/master-forge
target 0.11.3.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
setup() unconditionally forced metric.setNormalized(true) before
reading it back into the panel, so the checkbox never reflected the
user's previous choice. StatSettings.save() was a no-op that read the
metric's values but never wrote them anywhere.

Persist the Normalized setting via NbPreferences.forModule(...) per
this repo's Preferences convention, and drop the dead StatSettings
class along with the unused isDirected/isNormalized fields on this
class (never read elsewhere).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
No logic changes.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Every core Gephi Statistics panel (GraphDistancePanel, ModularityPanel,
PageRankPanel, etc.) uses org.jdesktop.swingx.JXHeader for a title +
description banner. This panel instead used a plain bold JLabel with
no description, which looked inconsistent next to other panels in the
Statistics UI.

Depend on org.gephi:ui-library-wrapper (the wrapper module that
exposes org.jdesktop.swingx.*, per this repo's dependency convention)
and rebuild the panel around a JXHeader, sized to give the header
enough room.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@mbastian
mbastian merged commit 2a6232e into gephi:master-forge Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants